package com.warrantyhotel.android.db;

import android.app.SearchManager;
import android.content.ContentResolver;
import android.net.Uri;
import android.provider.BaseColumns;

/**
 * This class describes tables of database and content uri's for Content
 * Provider
 */
public class WarrantyHotelDBSchema {
	/**
	 * Don't let anyone instantiate this class.
	 */
	private WarrantyHotelDBSchema() {
	}

	public static final String CONTENT_AUTHORITY = "com.warrantyhotel.android.db.WarrantyHotelProvider";
	private static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);

	public static final Uri buildContentUri(final String tableName) {
		return BASE_CONTENT_URI.buildUpon().appendPath(tableName).build();
	}

	private static final String buildContentType(final String tableName) {
		return ContentResolver.CURSOR_DIR_BASE_TYPE + "/vnd.com.warrantyhotel.android." + tableName;
	}

	public static interface CountryTable extends BaseColumns {
		String TABLE_NAME = "Country";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns

		String COUNTRY_ID = "country_id";
		String NAME = "name";
		String NAME_HACK = "name_hack";
		String PHONE_PREFIX = "phone_prefix";
		String USEADDRESSSTATE = "use_address_state";
	}

	public static interface StateTable extends BaseColumns {
		String TABLE_NAME = "State";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns

		String STATE_ID = "state_id";
		String COUNTRY_ID = "country_id";
		String STATE_NAME = "state_name";
		String STATE_NAME_HACK = "state_name_hack";
		String STATESHORTNAME = "stateShortName";
	}

	public static interface LanguageTable extends BaseColumns {
		String TABLE_NAME = "language";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns

		String LANGUAGE_ID = "language_id";
		String ENGLISH_NAME = "english_name";
		String NATIVE_NAME = "native_name";
		String CULTURE = "culture";
	}

	public static interface CurrencyTable extends BaseColumns {
		String TABLE_NAME = "currency";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns

		String CURRENCY_ID = "currency_id";
		String LABEL = "label";
		String PREFIX = "prefix";
	}

	public static interface WarrantiesTable extends BaseColumns {
		String TABLE_NAME = "warranties";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns

		String WARRANTY_ID = "warranty_id";
		String USER_LOGIN = "user_login";
		String ACCOUNT_ID = "account_id";
		String AREA_LIMIT_TEXT = "areaLimit_text";
		// new colums
		String LIST_LABEL = SearchManager.SUGGEST_COLUMN_TEXT_1;// "list_label";
		String IMAGE_URL = "image_url";
		String PRODUCT_ID = "product_id";
		String PRODUCT_NAME = "product_name";
		String MANUFACTURER_NAME = "manufacturer_name";
		String END_DATE = "end_date";
		String RETAIL_STORE_ID = "retail_store_id";
		String RETAIL_STORE_NAME = "retail_store_name";
		String RETAIL_NAME = "retail_name";
		String DESCRIPTION = "description";
		String SERVICE_NUMBER = "service_number";
		String SERVICE_EMAIL = "service_email";
		String PRODUCT_PRICE = "product_price";
		String ADDRESS_STREET = "address_street";
		String ADDRESS_POSTAL_CODE = "address_postal_code";
		String ADDRESS_CITY = "address_city";
		String ADDRESS_STATE_ID = "address_state_id";
		String ADDRESS_COUNTRY_ID = "address_country_id";
		String LATITUDE = "latitude";
		String LONGTITUDE = "longtitude";

		// is own warranty

		String WARRANTY_TYPE = "is_OWN_WARRANTY";

		// ACCOUNT TO UPLOAD
		// String ACCOUNT_UPLOAD_ID = "account_upload_id";
		String FILE_NAME = "file_name";
		String PRODUCT_NAME_TO_UPLOAD = "product_name_to_upload";
		String STORE_NAME = "store_name";
		String PURCHASE_DATE = "purchase_date";
		String CREATED_DATE = "created_date";
		String EXPIRATION_DATE = "expiration_date";
		String FILE_URL = "file_url";
		String CONTENT_TYPE_WARRANTY = "content_type";
		String THUMBNAIL_URL = "thumbnail_url";
		String COMMENTS = "comments";

	}

	public static interface News_RSS extends BaseColumns {
		String TABLE_NAME = "news_rss";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String GUID = "guid";
		String LINK = "link";
		String LINK_THUMBNAIL = "link_thumbnail";
		String LINK_BANNER = "link_banner";
		String TITLE = "title";
		String DESCRIPTION = "description";
		String DATE_UPDATE = "date_to_update";
	}

	public static interface FindStoresTable extends BaseColumns {
		String TABLE_NAME = "find_stores";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String RETAIL_STORE_ID = "retail_store_id";
		String RETAIL_ID = "retail_id";
		String NAME = SearchManager.SUGGEST_COLUMN_TEXT_1;
		String PHONE_PREFIX = "phone_prefix";
		String PHONE = "phone";
		String SERVICE_NUMBER = "service_number";
		String SERVICE_EMAIL = "service_email";
		String LOCATION_LATITUDE = "location_latitude";
		String LOCATION_LONGITUDE = "location_longitude";
		String DESCRIPTION = "description";
		String INFO = "info";
		String MAP_IMAGE_URL = "map_image_url";
		String THUMBNAIL = "thumbnail";
		String BANNER = "banner";
		String POI = "poi";
	}

	public static interface RetailStoresTable extends BaseColumns {
		String TABLE_NAME = "retail_stores_table";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		String RETAIL_STORE_ID = "retail_store_id";
		String RETAIL_ID = "retail_id";
		String NAME = "name";
		String ADDRESS_STREET = "address_street";
		String ADDRESS_POSTAL_CODE = "address_postal_code";
		String ADDRES_SCITY = "address_city";
		String PHONE_PREFIX = "phone_prefix";
		String PHONE = "phone";
		String SERVICE_NUMBER = "service_number";
		String SERVICE_EMAIL = "service_email";
		String LATITUDE = "location_latitude";
		String LONGTITUDE = "location_longitude";
		String ADDRESS_COUNTRY_ID = "address_country_id";
		String ADDRESS_STATE_ID = "address_state_id";
		String BANNER = "banner";
		String INFO = "info";
		String DESCRIPTION = "description";

	}

	public static interface GetFreeTable extends BaseColumns {
		String TABLE_NAME = "get_free";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String GET_FREE_ID = "get_free_id";
		String GET_FREE_ACTION_TYPE_ID = "get_free_action_type_id";
		String LABEL = "label";
		String CREATED_DATE = "created_date";
		String ACTION_TITLE = "action_title";
		String ACTION_TEXT = "action_text";
		String AWARD_UPLOADS = "award_uploads";
		String AWARD_CREDITS = "award_credits";
		String THUMBNAIL_LINK = "thumbnail_link";
		String BANNER_LINK = "banner_link";
	}

	// Inbox subTables
	public static interface Inbox_Information_Table extends BaseColumns {
		String TABLE_NAME = "inbox_information";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		String INFO_ID = "info_id";
		String TITLE = "title";
		String TEXT = "text";
		String EXPIRES = "expires";
		String ISVISIBLE = "isvible";
		String NAME_TABLE = "table_name";
	}

	public static interface Inbox_Free_Table extends BaseColumns {
		String TABLE_NAME = "inbox_free_table";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		String GET_FREE_ID = "get_free_id";
		String GET_FREE_ACTION_TYPE_ID = "get_free_action_type_id";
		String LABEL = "label";
		String CREATED_DATE = "created_date";
		String ACTION_TITLE = "action_title";
		String ACTION_TEXT = "action_text";
		String AWARD_UPLOADS = "award_uploads";
		String AWARD_CREDITS = "award_credits";
		String THUMBNAIL_LINK = "thumbnail_link";
		String BANNER_LINK = "banner_link";
		String END_DATE = "endDate";
		String ISVISIBLE = "isvisible";
		String NAME_TABLE = "table_name";
	}

	public static interface Inbox_RSS_Table extends BaseColumns {
		String TABLE_NAME = "inbox_rss";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String GUID = "syndication_item_id";
		String LINK = "link";
		String LINK_THUMBNAIL = "link_thumbnail";
		String LINK_BANNER = "link_banner";
		String TITLE = "title";
		String DESCRIPTION = "description";
		String CONTENT = "content";
		String DATE_UPDATE = "date_to_update";
		String NAME_TABLE = "table_name";
	}

	public static interface Inbox_Transactions_Table extends BaseColumns {
		String TABLE_NAME = "inbox_transactions";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String GUID = "warranty_transaction_id";
		String TITLE = "title";
		String TEASER = "teaser";
		String NAME_TABLE = "table_name";

	}

	public static interface Inbox_WarrantyTransfer_Table extends BaseColumns {
		String TABLE_NAME = "inbox_warranty_transfer";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String TITLE = "title";
		String TEASER = "teaser";
		String ITEM_NAME = "item_store";
		String STORE_NAME = "store_name";
		String GUID = "warranty_id";
		String LAST_CHANGED_DATE = "last_changed_date";
		String NAME_TABLE = "table_name";
	}

	public static interface Inbox_Account_Upload_Transfers_Table extends BaseColumns {
		String TABLE_NAME = "inbox_account_upload_transfers_tabale";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String GUID = "account_upload_id";

		String TITLE = "title";
		String PRODUCTNAME = "product_name";
		String TEASER = "teaser";
		String STORE_NAME = "store_name";
		String FILE_URL = "file_url";
		String PURCHASE_DATE = "purchase_date";
		String EXPIRATION_DATE = "expiration_date";
		String NAME_TABLE = "table_name";
	}

	public static interface Inbox_Warranty_Transfer_Inner_Table extends BaseColumns {
		String TABLE_NAME = "inbox_warranty_transfers_inner_table";
		Uri CONTENT_URI = buildContentUri(TABLE_NAME);
		String CONTENT_TYPE = buildContentType(TABLE_NAME);

		// table columns
		String WARRANTY_ID = "warranty_id";
		String ITEM_NAME = "item_name";
		String STORE_NAME = "store_name";
		String WARRANTY_TRANSACTION_ID = "warranty_transaction_id";
	}

	public interface Warranty_Country_State extends BaseColumns {
		public static final String NAME = "warranty_country_state";
		public static final Uri CONTENT_URI = buildContentUri(NAME);
		public static final String CONTENT_TYPE = buildContentType(NAME);
	}

	public interface Union_Inbox {
		public static final String NAME = "unioun_inbox";
		public static final Uri CONTENT_URI = buildContentUri(NAME);
		public static final String CONTENT_TYPE = buildContentType(NAME);
	}

}

